package com.tcc.qa.test.util;

import org.apache.xpath.operations.String;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class InputFinder {
	public static WebElement getInputById(WebDriver driver, String name) {
		return driver.findElement(By.id(name));
	}

	public static WebElement getInputById(WebDriver driver, String formname,
			String name) {
		return driver.findElement(By.xpath("//form[@name='" + formname + "']"))
				.findElement(By.id(name));
	}
	public static WebElement getInputByName(WebDriver driver, String name){
		return driver.findElement(By.name(name));
	}

	public static String getInputValueById(WebDriver driver, String name) {
		return getInputById(driver, name).getAttribute("value");

	}
	  public static WebElement getTextField(WebDriver driver, String name){
		 return driver.findElement(By.xpath("//input[@type='TEXT' and name='"+name+"']"));
	  }

}
